package org.turbobytes.unikey.util;

import org.turbobytes.unikey.util.exception.AssertionException;

/**
 * Assert utilities that will throw AssertionException if the assertion is incorrect
 *
 * @author Ganeshji Marwaha
 * @since Aug 7, 2010
 */
public class Assert {

  /**
   * throws AssertionException if the given object is null
   * @param object - to check if it is null
   */
  public static void isNotNull(Object object) {
    if(object == null)  {
      throw new AssertionException("Object expected to be not null, but is null");
    }
  }

  /**
   * throws AssertionException if the given object is not null
   * @param object - to check if it is not null
   */
  public static void isNull(Object object) {
    if(object != null) {
      throw new AssertionException("Object expected to be null, but is not null");  
    }
  }

}
